package com.yingxin.yxerp.module.sys.vo.resp;

import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yingxin.yx.framework.commons.vo.CommonRespVo;
import com.yingxin.yxerp.module.sys.entity.enums.MessageSendingOptionsType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 消息发送选项（平台）
 * @author yuebao
 * @since 2024-09-11
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="MessageSendingOptionsRespVo对象", description="消息发送选项")
public class MessageSendingOptionsRespVo extends CommonRespVo {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "发送平台：0 = 无任何发送，1 = 钉钉，2 = 企业微信")
    private String options;

    @ApiModelProperty(value = "发送平台名称")
    private String optionsName;

    public String getOptionsName() {
        MessageSendingOptionsType optionsType = MessageSendingOptionsType.getEnum( options );
        if( ObjectUtil.isNotEmpty( optionsType ) ) {
            return optionsType.getTypeName();
        }
        return null;
    }

    @ApiModelProperty("创建人id")
    protected String creatorId;

    @ApiModelProperty("创建人名称")
    protected String creatorName;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    protected Date createTime;

    @ApiModelProperty("更新者id")
    protected String updaterId;

    @ApiModelProperty("更新者名称")
    protected String updaterName;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    protected Date updateTime;

}
